<!DOCTYPE html>

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>数据添加</title>

<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache"> 
<meta http-equiv="Cache-Control" content="no-store, must-revalidate"> 
<meta http-equiv="expires" content="Wed, 26 Feb 2012 08:21:57 GMT"> 
<meta http-equiv="expires" content="0"> 
<link href="./css/public.css" rel="stylesheet" type="text/css">
<link href="./css/add.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="./My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="./ueditor143/ueditor.config.kbcms.js"></script>
<script type="text/javascript" charset="utf-8" src="./ueditor143/api.js"></script>
<script type="text/javascript" charset="utf-8" src="js/testApi.js"></script>

</head>
<body>
<a href="common.html">common</a><br/><a href="data.html">data</a><br/><a href="extend.html">extend</a><br/><a href="tree.html">tree</a>
 <h2>Data数据</h2>
<form name="country">
<input id="id" placeholder="请输入ID" value="143"  type="text" name="Id" class="text2" />
</form>
<a onClick="KBCMS.Data.Del(document.querySelector('#id').value)">删除</a>
<a onClick="KBCMS.Data.ById(document.querySelector('#id').value)">ID查找一条</a>
<a onClick="KBCMS.Data.All(document.querySelector('#id').value,10)">所有</a>

	<div  id="addui">
			<h3><a onclick="KBCMS.Data.Add()">添加</a> </h3>
			<ul > 
				<li><b class="c"> <input placeholder="标题" value="标题" type="text" name="Title" class="text100"></b></li>
				<li><b class="c"> <input placeholder="扩展ID" value="0"  type="number" name="ExtendId" class="text100"></b></li>
				<li><b class="c"> <input placeholder="目录ID" value="0" type="number" name="TreeId" class="text100"></b></li>
				<li><b class="c"> <input placeholder="超链接URL" value="超链接URL" type="text" name="Url" class="text100"></b></li>
				<li><b class="c"> <input placeholder="图片路径" value="图片路径"   type="text" name="ImgUrl" class="text100"></b></li>
				<li><b class="c"> <input placeholder="附件路径" value="附件路径"   type="text" name="Attachment" class="text100"></b></li>
				<li><b class="c"> <input placeholder="来源"  value="来源"  type="text" name="origin" value="" class="text2">
                <b class="c"> <input placeholder="发布日期"  value="2015-11-15 8:45:20"  type="text" name="published" id="Wdate1" class="Wdate" onclick="WdatePicker({ dateFmt:&#39;yyyy-MM-dd HH:mm:ss&#39; })"></b>
                </li>
				<li><b class="c"><script id="editor" type="text/plain" ></script><input type="hidden" name="content" ></b></li>
				<li><b class="c"> <textarea value="摘要信息"    class="text3" name="summary"></textarea></b></li>
				<li><b class="c"> <textarea value="关键词"    class="text3" name="referencewords"></textarea></b></li>
				<li><b class="c"><textarea  value="注释"     class="text3" name="note"></textarea> </b></li>
			</ul>
			<h3></h3>
	</div>
	<div id="viewDatas"></div>
<script type="text/javascript">
 
    function isFocus(e){
        alert(UE.getEditor('editor').isFocus());
        UE.dom.domUtils.preventDefault(e)
    }
    function setblur(e){
        UE.getEditor('editor').blur();
        UE.dom.domUtils.preventDefault(e);
    }

    function createEditor() {
        enableBtn();
        UE.getEditor('editor');
    }
    function getAllHtml() {
        alert(UE.getEditor('editor').getAllHtml())
    }
    function getContent() {
      return   UE.getEditor('editor').getContent()
    }
 
    function setContent(isAppendTo) {
        var arr = [];
        arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
        UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo);
        alert(arr.join("\n"));
    }
    function setDisabled() {
        UE.getEditor('editor').setDisabled('fullscreen');
        disableBtn("enable");
    }

    function setEnabled() {
        UE.getEditor('editor').setEnabled();
        enableBtn();
    }

    function getText() {
        //当你点击按钮时编辑区域已经失去了焦点，如果直接用getText将不会得到内容，所以要在选回来，然后取得内容
        var range = UE.getEditor('editor').selection.getRange();
		debugger
        range.select();
        var txt = UE.getEditor('editor').selection.getText();
        alert(txt)
    }

    function getContentTxt() {
        var arr = [];
        arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
        arr.push("编辑器的纯文本内容为：");
        arr.push(UE.getEditor('editor').getContentTxt());
        alert(arr.join("\n"));
    }
    function hasContent() {
        var arr = [];
        arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
        arr.push("判断结果为：");
        arr.push(UE.getEditor('editor').hasContents());
        alert(arr.join("\n"));
    }
    function setFocus() {
        UE.getEditor('editor').focus();
    }
    function deleteEditor() {
        disableBtn();
        UE.getEditor('editor').destroy();
    }
    function disableBtn(str) {
        var div = document.getElementById('btns');
        var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
        for (var i = 0, btn; btn = btns[i++];) {
            if (btn.id == str) {
                UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
            } else {
                btn.setAttribute("disabled", "true");
            }
        }
    }
    function enableBtn() {
        var div = document.getElementById('btns');
        var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
        for (var i = 0, btn; btn = btns[i++];) {
            UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
        }
    }

    function getLocalData () {
        alert(UE.getEditor('editor').execCommand( "getlocaldata" ));
    }

    function clearLocalData () {
        UE.getEditor('editor').execCommand( "clearlocaldata" );
        alert("已清空草稿箱")
    }
   function insertHtml(value) {
        //var value = prompt('插入html代码', '');
       
        UE.getEditor('editor').execCommand('insertHtml', value)
    }
</script>

 


 

</body></html>